#include <stdio.h>

int main()
{
    FILE *fp = NULL;

    fp = fopen("test.txt", "w+");//current directory

    fputc('f',fp);
    fputc('p',fp);
    fputc('u',fp);
    fputc('t',fp);
    fputc('c',fp);
    fputc('\n',fp);
    fputs("This is testing for fputs...\n", fp);
    fprintf(fp, "This is testing for fprintf %d...\n",1);
    fprintf(fp, "This is testing for fprintf %d...\n",2);

    fclose(fp);
}

